home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / DOC_UTIL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  907 b   |  31 lines

  1. /*  doc_util.c - utilities for document index programs */
  2. #include   "stdio.h"
  3. #include   "ctype.h"
  4.  
  5. int  cmp_part(s1,s2)                    /* compare all chars in s1 to s2 */
  6.   char  s1[] ;                          /* first string */
  7.   char  s2[] ;                          /* second string */
  8.   {
  9.      int   i, n, ret ;
  10.  
  11.      n = strlen(s1) ;
  12.      for(i=0 ; i<n ; i=i+1)             /* compare no chars in s1 */
  13.         {  ret = tolower(s1[i]) - tolower(s2[i]) ;
  14.            if( ret != 0 )
  15.               break ;
  16.         }
  17.      return( ret ) ;
  18.   }
  19.  
  20. int  add_str(result,s1,s2)              /* concentrate two strings */
  21.   char  result[] ;                      /* put the completed result here */
  22.   char  s1[] ;                          /* first string */
  23.   char  s2[] ;                          /* second string */
  24.   {
  25.      strcpy(result,s1) ;
  26.      strcpy(result,s2) ;
  27.   }
  28.  
  29.  
  30.  
  31.